using System.Collections;
using System.Collections.Generic;
using Spine.Unity;
using UnityEngine;

public  static class PluginUtil 
{
    public static string GetCurrentAnimationName(this SkeletonGraphic  skeletonGraphic)
    {
        // 获取 AnimationState
        var animationState = skeletonGraphic.AnimationState;

        // 获取当前轨道上的 Entry
        var currentEntry = animationState.GetCurrent(0); // 0 是动画轨道的索引，如果你有多个轨道可以修改这个值

        if (currentEntry != null)
        {
            return currentEntry.Animation.Name;
        }

        return null;
    }
    
}
